﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using CLEX.AdminUI.Service;
using CLEX.AdminUI.Services;
using CLEX.AdminUI.ViewModel;

namespace CLEX.AdminUI
{
    internal sealed class Facade
    {
        private readonly MessageService messageService;
        private readonly ProxyService proxyService;
        private readonly WindowService windowService;

        public Facade(MessageService messageService, ProxyService proxyService, WindowService windowService)
        {
            this.messageService = messageService;
            this.proxyService = proxyService;
            this.windowService = windowService;
        }



        public List<SharedDatabaseData> GetAllSharedDatabases()
        {
            return proxyService.GetAllSharedDatabases();
        }

        public void CreateSharedDatabase(SharedDatabaseData sharedDatabase)
        {
            proxyService.CreateSharedDatabase(sharedDatabase);
        }

        public void DeleteSharedDatabase(SharedDatabaseData sharedDatabase)
        {
            proxyService.DeleteSharedDatabase(sharedDatabase);
        }

        public void UpdateSharedDatabase(SharedDatabaseData sharedDatabase)
        {
            proxyService.UpdateSharedDatabase(sharedDatabase);
        }



        public List<UserData> GetAllUsers()
        {
            return proxyService.GetAllUsers();
        }

        public void CreateUser(UserData user)
        {
            proxyService.CreateUser(user);
        }

        public void DeleteUser(UserData user)
        {
            proxyService.DeleteUser(user);
        }

        public void UpdateUser(UserData user)
        {
            proxyService.UpdateUser(user);
        }

        public PasswordChangeResultData ChangeUserPassword(int userId, string oldPassword, string newPassword)
        {
            return proxyService.ChangeUserPassword(userId, oldPassword, newPassword);
        }


        public List<FriendRequestData> GetAllFriendRequests()
        {
            return proxyService.GetAllFriendRequests();
        }

        public void CreateFriendRequest(FriendRequestData friendRequest)
        {
            proxyService.CreateFriendRequest(friendRequest);
        }

        public void DeleteFriendRequest(FriendRequestData friendRequest)
        {
            proxyService.DeleteFriendRequest(friendRequest);
        }

        public void UpdateFriendRequest(FriendRequestData friendRequest)
        {
            proxyService.UpdateFriendRequest(friendRequest);
        }



        public List<FriendshipData> GetAllFriendships()
        {
            return proxyService.GetAllFriendships();
        }

        public void CreateFriendship(FriendshipData friendship)
        {
            proxyService.CreateFriendship(friendship);
        }

        public void DeleteFriendship(FriendshipData friendship)
        {
            proxyService.DeleteFriendship(friendship);
        }

        public void UpdateFriendship(FriendshipData friendship)
        {
            proxyService.UpdateFriendship(friendship);
        }



        public List<DatabaseData> GetAllDatabases()
        {
            return proxyService.GetAllDatabases();
        }

        public void CreateDatabase(DatabaseData database)
        {
            proxyService.CreateDatabase(database);
        }

        public void DeleteDatabase(DatabaseData database)
        {
            proxyService.DeleteDatabase(database);
        }

        public void UpdateDatabase(DatabaseData database)
        {
            proxyService.UpdateDatabase(database);
        }



        public bool ConfirmDelete(string itemName)
        {
            return messageService.ConfirmDelete(itemName);
        }

        public void ShowError(string message, Exception innerException)
        {
            messageService.ShowError(message, innerException);
        }
    }
}
